package cn.iocoder.yudao.module.gov.dal.mysql.resourcecatalog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.gov.dal.dataobject.resourcecatalog.ResourceCatalogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.gov.controller.admin.resourcecatalog.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 政务资源菜单树 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ResourceCatalogMapper extends BaseMapperX<ResourceCatalogDO> {

    default PageResult<ResourceCatalogDO> selectPage(ResourceCatalogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResourceCatalogDO>()
                .likeIfPresent(ResourceCatalogDO::getMenuName, reqVO.getMenuName())
                .eqIfPresent(ResourceCatalogDO::getClassifySj, reqVO.getClassifySj())
                .eqIfPresent(ResourceCatalogDO::getCatalogNumber, reqVO.getCatalogNumber())
                .eqIfPresent(ResourceCatalogDO::getImputationNumber, reqVO.getImputationNumber())
                .eqIfPresent(ResourceCatalogDO::getApiNumber, reqVO.getApiNumber())
                .eqIfPresent(ResourceCatalogDO::getFileNumber, reqVO.getFileNumber())
                .eqIfPresent(ResourceCatalogDO::getTabNumber, reqVO.getTabNumber())
                .betweenIfPresent(ResourceCatalogDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(ResourceCatalogDO::getParentName, reqVO.getParentName())
                .eqIfPresent(ResourceCatalogDO::getMenuDesc, reqVO.getMenuDesc())
                .eqIfPresent(ResourceCatalogDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(ResourceCatalogDO::getDeptName, reqVO.getDeptName())
                .eqIfPresent(ResourceCatalogDO::getReposeId, reqVO.getReposeId())
                .eqIfPresent(ResourceCatalogDO::getUpdataType, reqVO.getUpdataType())
                .eqIfPresent(ResourceCatalogDO::getReport, reqVO.getReport())
                .eqIfPresent(ResourceCatalogDO::getMenuCode, reqVO.getMenuCode())
                .betweenIfPresent(ResourceCatalogDO::getUpdataTime, reqVO.getUpdataTime())
                .orderByDesc(ResourceCatalogDO::getId));
    }

    int deleteAll();

}